<%= page_title @environment.name %>

<section>
  <div style="float: right;">
    <p>
      <a class="toggle" data-target="tr.no-deploys" href="#">Toggle Projects without Deploys</a>
    </p>
    <p>
      <a href="?failed_deploys=<%= !@failed_deploys %>">Toggle Failed Deploys</a>
    </p>
  </div>

  <p>
    <%= form_tag "", method: :get do %>
      Status at <%= datetime_local_field_tag :before, @before.strftime("%Y-%m-%dT%H:%M:%S") %>
      <%= submit_tag "Timetravel" %>
    <% end %>
  </p>

  <div>
    <table class="table fixed-header-column">
      <thead>
      <tr>
        <th>Project</th>
        <% @deploy_groups.each do |deploy_group| %>
          <th><%= link_to deploy_group.name, deploy_group %></th>
        <% end %>
      </tr>
      </thead>

      <tbody>
        <% @projects.each do |project| %>
          <%= render partial: 'row', locals: {project: project} %>
        <% end %>
      </tbody>
    </table>
  </div>
</section>
